﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;

namespace WXSend
{
    public class Program
    { 
        public static void Main(string[] args)
        {
            CreateWebHostBuilder(args).Build().Run();   
        }

        public static IWebHostBuilder CreateWebHostBuilder(string[] args)
        {
            //LoggingConfiguration
            //ServiceCollectionServiceExtensions.AddSingleton<IOptionsChangeTokenSource<LoggerFilterOptions>>(builder.Services, new ConfigurationChangeTokenSource<LoggerFilterOptions>(configuration));
            return WebHost.CreateDefaultBuilder(args).ConfigureLogging((hostingContext, logging) =>
      {
          //从appsettings.json中获取Logging的配置
          // logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
          //添加控制台输出
          logging.AddConsole();
          ////添加调试输出
          //logging.AddDebug();
          logging.AddTraceSource("");
      })
                       .UseStartup<Startup>();
        }
    }
}
